<template>
  <div class="son">
    <h1>我是子组件</h1>
    <p>{{props.info}}</p>
    <p>{{props.money}}</p>
<!--    可以省略代理对象props-->
    <p>{{info}}</p>
    <p>{{money}}</p>
    <button @click="updateProps">修改props</button>
  </div>

</template>

<script setup lang="ts">
let props = defineProps(['info', 'money']);
console.log(props);

const updateProps = () => {
  // props只读
  props.money+=10;
}
</script>

<style scoped>
  .son {
    width: 400px;
    height: 200px;
    background: hotpink;
  }
</style>